package com.atguigu.guli.service.edu;


import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import feign.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
//@MapperScan(basePackages = "com.atguigu.guli.service.edu.mapper") 放在配置类上面
@ComponentScan(value = "com.atguigu.guli")
@EnableFeignClients(basePackages = "com.atguigu.guli.service")
@EnableCaching //开启缓存管理
public class ServiceEduApplication {
    public static void main(String[] args) {
        SpringApplication.run(ServiceEduApplication.class,args) ;
    }
    @Bean
    public Logger.Level level() {
        //feign也使用logback输出日志，日志级别为debug级别
        return Logger.Level.FULL ;
    }
    @Bean
    public IRule rule() {
        return new RandomRule() ;
    }
}
